package app.texas.com.devilfishhouse.View.Fragment.mine;

import android.content.Intent;
import android.view.View;
import android.widget.LinearLayout;

import com.universal_library.fragment.BaseFragment;

import app.texas.com.devilfishhouse.Base.BaseFragmentView;
import app.texas.com.devilfishhouse.Base.BasePresenter;
import app.texas.com.devilfishhouse.R;
import app.texas.com.devilfishhouse.View.login.LoginView;
import app.texas.com.devilfishhouse.ui.SimpleBackPage;
import app.texas.com.devilfishhouse.ui.UiHelper;
import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by solin on 2018/7/16.
 */

public class MineFragmentView extends BaseFragmentView implements View.OnClickListener {
    MinePresenter minePresenter;

    @BindView(R.id.ll_mywallet)
    LinearLayout ll_mywallet;

    @BindView(R.id.ll_myOrder)
    LinearLayout ll_myOrder;

    @BindView(R.id.ll_mysubordinates)
    LinearLayout ll_mysubordinates;

    @BindView(R.id.ll_tuiguang)
    LinearLayout ll_tuiguang;

    @BindView(R.id.ll_loginout)
    LinearLayout ll_loginout;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_mine;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView(View view) {
        super.initView(view);

    }

    @Override
    protected BasePresenter getPresenter() {
        minePresenter = new MinePresenter(this);
        return minePresenter;
    }

    @OnClick({R.id.ll_mywallet, R.id.ll_myOrder, R.id.ll_mysubordinates, R.id.ll_tuiguang,
            R.id.ll_coupon, R.id.seeHouse, R.id.ll_loginout, R.id.iv_erweima, R.id.iv_setting})
    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ll_mywallet:
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.MYWALLET, null);
                break;
            case R.id.ll_myOrder:
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.MYORDER, null);
                break;
            case R.id.ll_mysubordinates:
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.MYSUBORDINATES, null);
                break;
            case R.id.iv_erweima:
            case R.id.ll_tuiguang:
                //推广
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.TUIGUANG, null);
                break;
            case R.id.ll_coupon:
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.MYCOUPON, null);
                break;
            case R.id.seeHouse:
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.CUSTOMERSEEHOUSE, null);
                break;
            case R.id.ll_loginout:
                startActivity(new Intent(mContext, LoginView.class));
                break;
            case R.id.iv_setting:
                UiHelper.shoSimpleBack(mContext, SimpleBackPage.SETTING, null);
                break;

        }
    }
}
